package cn.taoticket.service;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import cn.taoticket.mapper.TaoticketLinkUserMapper;
import cn.taoticket.pojo.TaoticketLinkUser;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketLinkUserService {

     @Resource
     private TaoticketLinkUserMapper taoticketLinkUserMapper;

     @RequestMapping(value = "/getTaoticketLinkUserById",method = RequestMethod.POST)
     public TaoticketLinkUser getTaoticketLinkUserById(@RequestParam("id") Long id)throws Exception{
        return taoticketLinkUserMapper.getTaoticketLinkUserById(id);
     }

     @RequestMapping(value = "/getTaoticketLinkUserListByMap",method = RequestMethod.POST)
     public List<TaoticketLinkUser>	getTaoticketLinkUserListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketLinkUserMapper.getTaoticketLinkUserListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketLinkUserCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketLinkUserCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketLinkUserMapper.getTaoticketLinkUserCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketLinkUser",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketLinkUser(@RequestBody TaoticketLinkUser taoticketLinkUser)throws Exception{
        taoticketLinkUser.setCreatedTime(new Date());
        return taoticketLinkUserMapper.insertTaoticketLinkUser(taoticketLinkUser);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketLinkUser",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketLinkUser(@RequestBody TaoticketLinkUser taoticketLinkUser)throws Exception{
        taoticketLinkUser.setUpdatedTime(new Date());
        return taoticketLinkUserMapper.updateTaoticketLinkUser(taoticketLinkUser);
     }
}
